import { findCurrent,getCode,buyCurrent } from '../../http/orders.js'
export default ({
	namespaced:true,
	state:{
		currentLists:[]
	},
	mutations:{
		renderCurrentId(state,data){
			state.currentLists=data;
		}
	},
	actions:{
		//通过id查找活期理财
	async findCurrentbyId(context,data){
			const result=await findCurrent(data);
			console.log(result);
			if(result.code){
				context.commit("renderCurrentId",result.data.list);
				console.log(result.data.list)
			}
			
		},
			//  获取短信验证
			async getCode(state,data) {
				console.log(data,'data');
				return await getCode(data)
				 
				 }, 
			//  购买黄金
			async buyCurrent(state,data) {
				return await buyCurrent(data)
				 
				 }, 

	}
})